package com.common.converter;

import com.common.entity.department.DepartmentEntity;
import com.common.entity.job.JobEntity;
import com.common.requestvo.departmentjob.DepartmentReqVo;
import com.common.requestvo.departmentjob.JobReqVo;
import com.common.vo.departmentjob.DepartmentVo;
import com.common.vo.departmentjob.JobVo;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

/**
 * @author johnny
 * @create 2020-07-13 下午5:04
 **/
@Mapper
public interface DepartmentConverter {

    DepartmentConverter INSTANCE = Mappers.getMapper(DepartmentConverter.class);


    @Mappings({
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
    })
    DepartmentVo domain2vo(DepartmentEntity departmentEntity);

    @Mappings({
            @Mapping(source = "createTime", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
            @Mapping(source = "updateTime", target = "updateTime", dateFormat = "yyyy-MM-dd HH:mm:ss"),
    })
    DepartmentEntity vo2domain(DepartmentReqVo departmentReqVo);
}